package com.soen6441.generics;
import java.util.*;

class Generics {
    public static void main(String[] args) {
        List<String> stuff = new ArrayList<String>();
        stuff.add("Troy");
        // no cast needed
        stuff.get(0).contains("r");
        // doesn't compile type safe
        //stuff.add(1);
        List<Integer> ints = new ArrayList<Integer>();
        // auto boxes int primitive into Integer object
        ints.add(1);
        // example of generic verbosity
        Map<Character, Set<String> > multimap =
                new HashMap<Character, Set<String>>();
    }

    // The verbosity gets worse in methods that use
    // a lot generics
    Map<Character, Set<String> > copyMultiMap(
                                 Map<Character, Set<String> > toCopy){
        return null;
    }
}
